<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="../script/pivot.js"></script>
<script type="text/javascript" src="../script/crosstab.js"></script>
<meta name="author" content="CarlHuang">
<title>客户积分查询</title>
<script language="javascript" src="../script/common.js"
	type="text/javascript"></script>
<script language="javascript" type="text/javascript"> 	
		var qt={};
		var qt2={};
		var qt3={};
     function load(){
	   Eui.showNavigation();
         Common.initDict(searchForm.idnoType1,"idno_type","全 部");
         Common.initDict(searchForm.idnoType2,"idno_type","全 部");
         Common.initDict(searchForm.carduser,"carduser_customer");
         $("searchForm").reset();
         if($("searchForm").carduser.value=="1") { 
	 $("customer").style.display="";
	 $("orgcustomer").style.display="none";
	 }
	if($("searchForm").carduser.value=="2"){

	 $("customer").style.display="none";
	 $("orgcustomer").style.display="";
	}
	      setPages(["listView","listview2"]);
	 }
	   function showData1(){
	      if($("searchForm").carduser.value=="1")
	      { 
	       createTable1();
	       qt.showTable();
	        $("datalist").style.display="";
	      }
	      else{
	      createTable2();
	      qt2.showTable();
	       $("datalist").style.display="";
	      }
	    
    }
    function lookback(){
	     switchPage("listView");  
    }
     
	 function createTable1(){   
	 var columns =[];
	  columns[8]={title:"操作",width:"9%",align:"center",render:ckFunc,order:false}
	   qt = new QueryTable("loy_customer_value_query5","searchForm","datalist",columns
				);
	}	
	function createTable2(){
    var columns =[];
     columns[8]={title:"操作",width:"9%",align:"center",render:ckFunc,order:false}
    qt2 = new QueryTable("loy_orgcustomer_value_query5","searchForm","datalist",columns
				);
	}	
	function createTable3(){
	   var columns =[];
	   qt3 = new QueryTable("loy_account_check5","searchForm2","datalist2",columns
				);
	}	
	  function chakan(id){
	   $("searchForm2").accountid.value=id;
	  createTable3();
	  qt3.showTable();
	  switchPage("listview2");   
	 
	}
	function ckFunc(v,r){
	return	"<a href=# onclick=\"chakan('"+r[0]+"');return false;\">查看分段积分</a>";
	}
	function check(){
         if($("searchForm").carduser.value=="1") { 
	 $("customer").style.display="";
	 $("orgcustomer").style.display="none";
	 }
	if($("searchForm").carduser.value=="2"){
	 $("customer").style.display="none";
	 $("orgcustomer").style.display=""; 
	}
	}
	function cancel(){
	    switchPage("listView");    
	}
		
			
		</script>
</head>
<body onload="load()">
<div class="nav">
<div id="nav">&nbsp;</div>
</div>
<div id="listView">
<div class="searchForm">
<form id='searchForm' name='searchForm'>
<table cellSpacing="0" cellPadding="4" width="100%" border="0">
	<tr>
		<td><label>客户类型</label>&nbsp;&nbsp;&nbsp;<select
			name="carduser" id="carduser" onchange="check();"></select> <span class='des'>*</span>
		</td>
		<td><label>卡 账 号</label>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text" name="cardNumber">
		</td>
	</tr>	
	  <tr  id="customer" style="display:none">
		<td><label>客户姓名</label>&nbsp;&nbsp; <input type="text" name="cardUserName">
		</td>
		<td><label>证件类型</label>&nbsp;&nbsp;&nbsp;&nbsp; <select
			name="idnoType1" onchange="checkV(searchForm.idno1,this.value)"></select></td>
		<td><label>证 件 号</label>&nbsp;&nbsp;&nbsp;&nbsp; <input
			type="text" name="idno1"
			onblur="checkV(this,searchForm.idnoType1.value)"></td>
		
	</tr>
	<tr  id="orgcustomer" style="display:none" >
	    <td><label>单位名称</label> <input type="text" name="orgName">
		</td>
		<td><label>证件类型</label>&nbsp;&nbsp;&nbsp;&nbsp; <select
			name="idnoType2" onchange="checkV(searchForm.idno2,this.value)"></select></td>
		<td><label>证 件 号</label>&nbsp;&nbsp;&nbsp;&nbsp; <input
			type="text" name="idno2"
			onblur="checkV(this,searchForm.idnoType2.value)"></td>
	</tr>
		<tr>
		<td>
		<button type="button" onclick="showData1()">查 询</button>
		</td>
        </tr>
</table>
</form>
</div>
<div id="datalist"  style="display:none"></div>
</div>


<div id="listview2" style="display: none;">
<div class="searchForm2">
<form id='searchForm2' name='searchForm2'>
<table cellSpacing="0" cellPadding="4" width="100%" border="0">
	<input type="hidden" name="accountid" id="accountid" />
	<tr>
		<td></td>
		<td></td>
		<td>
		</td>
	</tr>
</table>
</form>
</div>
<div id="datalist2"></div>
<td>
		<button type="button" onclick="cancel()">返回</button>
		</td>
</div>
</body>
</html>
